<template>
	<!-- 面试详情页面 -->
	<view class="details">
		<!-- 地图 -->
		<view class="page-body">
			<view class="page-section page-section-gap">
				<map style="width: 100%; height: 300px;" :latitude="latitude" :longitude="longitude" :markers="covers">
				</map>
			</view>
		</view>
		<!-- 面试详情 -->
		<view class="example" :modelValue="baseData">
			<view>
				<label>招聘平台：</label>
				<uni-easyinput class="labbb" :modelValue="baseData.plat" disabled />
			</view>
			<view>
				<label>面试公司：</label>
				<uni-easyinput class="labbb" :modelValue="baseData.companyname" disabled />
			</view>
			<view>
				<label>面试岗位：</label>
				<uni-easyinput class="labbb" :modelValue="baseData.job" disabled />
			</view>
			<view>
				<label>预约时间：</label>
				<uni-easyinput class="labbb" :modelValue="baseData.timeview" disabled />
			</view>
			<view>
				<label>人事电话：</label>
				<uni-easyinput class="labbb" :modelValue="baseData.phone" disabled />
			</view>
			<view>
				<label>面试要求：</label>
				<uni-easyinput class="labbb" :modelValue="baseData.info" disabled />
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: 0, // 使用 marker点击事件 需要填写id 
				title: 'map',
				latitude: null,
				longitude: null,
				covers: [{
					latitude: null,
					longitude: null,
					iconPath: '../../static/marker.png'
				}],
				baseData: {
					companyname: '',
					latlang: '',
					job: '',
					phone: '',
					plat: 0,
					timeview: '',
					info: ''
				},
			}
		},
		onLoad(options) {
			this.baseData = JSON.parse(options.obj)
			this.covers[0].latitude = this.baseData.latlang.split(",")[1]
			this.covers[0].longitude = this.baseData.latlang.split(",")[0]
			this.latitude = this.baseData.latlang.split(",")[1]
			this.longitude = this.baseData.latlang.split(",")[0]
			let num;
			switch (this.baseData.plat) {
				case 1:
					num = "拉勾网";
					break;
				case 2:
					num = "前程无忧";
					break;
				case 3:
					num = "boss直聘";
					break;
				case 4:
					num = "智联招聘";
					break;
				default:
			}
			this.baseData.plat = num
		},
	}
</script>

<style>
	.example .labbb {
		display: inline-block;
		width: 75%;
	}

	.example {
		padding: 20px;
		background-color: #fff;
	}

	.example view {
		margin-bottom: 6px;
	}
</style>
